package com.aquarium.config;

import android.R.integer;
import android.content.Context;

import com.aquarium.R;

public class WaveMode {

	public static String WAVE_MODE_1;
	public static String WAVE_MODE_2;
	public static String WAVE_MODE_3;
	public static String WAVE_MODE_4;
	public static String WAVE_MODE_5;
	public static String WAVE_MODE_6;

	public final static int WAVE_MODE_1_INT = 1;
	public final static int WAVE_MODE_2_INT = 2;
	public final static int WAVE_MODE_3_INT = 3;
	public final static int WAVE_MODE_4_INT = 4;
	public final static int WAVE_MODE_5_INT = 5;
	public final static int WAVE_MODE_6_INT = 6;

	private WaveMode() {

	}

	public static void init(Context context) {
		WAVE_MODE_1 = context.getString(R.string.mode_1);
		WAVE_MODE_2 = context.getString(R.string.mode_2);
		WAVE_MODE_3 = context.getString(R.string.mode_3);
		WAVE_MODE_4 = context.getString(R.string.mode_4);
		WAVE_MODE_5 = context.getString(R.string.mode_5);
		WAVE_MODE_6 = context.getString(R.string.mode_6);
	}

	public static int getWaveModeInt(String waveMode) {
		if (WAVE_MODE_1.equals(waveMode)) {
			return WAVE_MODE_1_INT;
		} else if (WAVE_MODE_2.equals(waveMode)) {
			return WAVE_MODE_2_INT;
		} else if (WAVE_MODE_3.equals(waveMode)) {
			return WAVE_MODE_3_INT;
		} else if (WAVE_MODE_4.equals(waveMode)) {
			return WAVE_MODE_4_INT;
		} else if (WAVE_MODE_5.equals(waveMode)) {
			return WAVE_MODE_5_INT;
		} else if (WAVE_MODE_6.equals(waveMode)) {
			return WAVE_MODE_6_INT;
		}
		return -1;
	}

	public static String getWaveModeString(int waveMode) {
		switch (waveMode) {
		case 1:
			return WAVE_MODE_1;
		case 2:
			return WAVE_MODE_2;
		case 3:
			return WAVE_MODE_3;
		case 4:
			return WAVE_MODE_4;
		case 5:
			return WAVE_MODE_5;
		case 6:
			return WAVE_MODE_6;
		default:
			break;
		}
		return null;
	}
}
